package com.zc.z_test;

import com.zc.dao.UsersMapper;
import com.zc.entity.Odds;
import com.zc.service.OddService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/*.xml"})
public class MyBatisCacheSecondTest
{
    private static final Logger logger = LoggerFactory.getLogger(MyBatisCacheSecondTest.class);

    @Autowired
    private OddService service;

    /*
     * 二级缓存测试
     */
    @Test
    public void testCache2() {
        List<Odds> all = service.findAll();
        logger.debug("odd show ::,{}",all.size());
        List<Odds> all1 = service.findAll();
        logger.debug("odd1 show ::,{}",all1.size());

    }

}
